package com.bsoft.gol.hbs.bbpmessagel.template;

import java.beans.ConstructorProperties;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author tongtp
 * @version v0.1
 * @Package com.bsoft.platform.service.sendMsg.impl.weChat.template
 * @className WxMiniSubscribeMessage
 * @description 微信小程序订阅消息消息体
 * @create 2020-10-16 13:58
 **/
public class WxMiniSubscribeMessage implements Serializable {
	private static final long serialVersionUID = -6479822568622579814L;
	private String toUser;
	private String templateId;
	private String page;
	private String miniprogramState;
	private String lang;
	private List<WxMiniSubscribeData> data;

	public WxMiniSubscribeMessage() {
	}

	@ConstructorProperties({"toUser", "templateId", "page", "miniprogramState", "lang", "data"})
	public WxMiniSubscribeMessage(String toUser, String templateId, String page, String miniprogramState,
                                  String lang, List<WxMiniSubscribeData> data) {
		this.toUser = toUser;
		this.templateId = templateId;
		this.page = page;
		this.miniprogramState = miniprogramState;
		this.lang = lang;
		this.data = data;
	}

	public static WxMiniSubscribeMessage.WxMiniSubscribeMessageBuilder builder() {
		return new WxMiniSubscribeMessage.WxMiniSubscribeMessageBuilder();
	}

	public static long getSerialVersionUID() {
		return serialVersionUID;
	}

	public WxMiniSubscribeMessage addData(WxMiniSubscribeData datum) {
		if (this.data == null) {
			this.data = new ArrayList();
		}

		this.data.add(datum);
		return this;
	}

	public String toJson() {
		return WxMpGsonBuilder.INSTANCE.create().toJson(this);
	}

	public String getToUser() {
		return toUser;
	}

	public void setToUser(String toUser) {
		this.toUser = toUser;
	}

	public String getTemplateId() {
		return templateId;
	}

	public void setTemplateId(String templateId) {
		this.templateId = templateId;
	}

	public String getPage() {
		return page;
	}

	public void setPage(String page) {
		this.page = page;
	}

	public String getMiniprogramState() {
		return miniprogramState;
	}

	public void setMiniprogramState(String miniprogramState) {
		this.miniprogramState = miniprogramState;
	}

	public String getLang() {
		return lang;
	}

	public void setLang(String lang) {
		this.lang = lang;
	}

	public List<WxMiniSubscribeData> getData() {
		return data;
	}

	public void setData(List<WxMiniSubscribeData> data) {
		this.data = data;
	}

	public static class WxMiniSubscribeMessageBuilder {
		private String toUser;
		private String templateId;
		private String page;
		private String miniprogramState;
		private String lang;
		private List<WxMiniSubscribeData> data;

		public WxMiniSubscribeMessageBuilder() {
		}

		public WxMiniSubscribeMessage.WxMiniSubscribeMessageBuilder toUser(String toUser) {
			this.toUser = toUser;
			return this;
		}

		public WxMiniSubscribeMessage.WxMiniSubscribeMessageBuilder templateId(String templateId) {
			this.templateId = templateId;
			return this;
		}

		public WxMiniSubscribeMessage.WxMiniSubscribeMessageBuilder page(String page) {
			this.page = page;
			return this;
		}

		public WxMiniSubscribeMessage.WxMiniSubscribeMessageBuilder miniprogramState(String miniprogramState) {
			this.miniprogramState = miniprogramState;
			return this;
		}

		public WxMiniSubscribeMessage.WxMiniSubscribeMessageBuilder lang(String lang) {
			this.lang = lang;
			return this;
		}

		public WxMiniSubscribeMessage.WxMiniSubscribeMessageBuilder data(List<WxMiniSubscribeData> data) {
			this.data = data;
			return this;
		}

		public WxMiniSubscribeMessage build() {
			return new WxMiniSubscribeMessage(this.toUser, this.templateId, this.page, this.miniprogramState,
					lang, this.data);
		}

		@Override
		public String toString() {
			return "WxMiniSubscribeMessage.WxMiniSubscribeMessageBuilder(toUser=" + this.toUser + "," +
					" templateId=" + this.templateId + ", page=" + this.page + ", miniprogramState=" +
					this.miniprogramState + ", lang=" + this.lang + ", data=" + this.data + ")";
		}
	}
}
